package com.netease.nie.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.netease.nie.base.utils.CopyUtils;
import com.netease.nie.dao.ExchangeGoodsInfoDao;
import com.netease.nie.dao.ExchangeGoodsInfoExtendDao;
import com.netease.nie.dto.ExchangeGoodsConfigDto;
import com.netease.nie.model.ExchangeGoodsInfo;
import com.netease.nie.model.ExchangeGoodsInfoExtend;
/**
 * 
 * @author wwbn3695
 * @createDate July 15th,2016
 *
 */
@Service
public class ExchangeGoodsConfigServiceImpl implements ExchangeGoodsConfigService {

	@Autowired
	private ExchangeGoodsInfoDao exchangeGoodsInfoDao;
	
	@Autowired
	private ExchangeGoodsInfoExtendDao exchangeGoodsInfoExtendDao;
	
	public ExchangeGoodsConfigDto queryGoodsConfigDtoById(int id) {
		ExchangeGoodsInfo exchangeGoodsInfo = exchangeGoodsInfoDao.queryGoodsInfoById(id);
		ExchangeGoodsInfoExtend exchangeGoodsInfoExtend = exchangeGoodsInfoExtendDao.queryGoodsInfoExtendById(id);		
		ExchangeGoodsConfigDto exchangeGoodsConfigDto = new ExchangeGoodsConfigDto();
		CopyUtils.copy(exchangeGoodsConfigDto, exchangeGoodsInfo);
		CopyUtils.copy(exchangeGoodsConfigDto, exchangeGoodsInfoExtend);
		return exchangeGoodsConfigDto;
	}

}
